package com.netstar.jsonparser;

import java.io.IOException;

import org.json.JSONException;
import org.json.JSONObject;

import com.netstar.property.ServerError;

public class ServerErrorParser extends AbstractParser {

	public ServerErrorParser(String data) {
		super(data);
	}

	protected String getClassName() {
		return ServerError.CLASS_NAME;
	}

	public Object parse() throws JSONException, IOException {
		final String source = dataSource;
		if (null == source || source.length() <= 0) {
			return null;
		}
		JSONObject jo = new JSONObject(source);
		return parseObject(jo);
	}

}
